This tool will help you understand how to use Gama Server.
It allows you to see which messages to send, and to decrypt messages received and their meaning.
It will familiarize you with this powerful tool.
About Gama Server, it's a server that starts up every time you launch GAMA, opens a websocket port and waits for clients to come and control it.
Gama Server Connector is an example of a client, which implements all the requests you can send to Gama Server.
Check that you are connected to Gama Server, as can be seen in the Connection information section.
You must have CONNECTED status.
If this is not the case, check and, if necessary, modify the Gama Server web address in the Address section.
Enter the absolute path to your .gaml file on the machine running GAMA, and the name of the experiment
you wish to view in the Load An Experiment section. Click the checkmark to apply these values.
Spaces in file and folder names are supported, including on macOS: for example,
/Users/alice/My models/Model with spaces.gaml.
Enter the path as plain text, without surrounding quotes, shell escapes such as \ ,
or URL encoding such as %20.
Launch the model by clicking on Load / Reload in the Simulation Commands section.
You can check whether the model has been launched by looking at the GAMA response messages.
You should receive a CommandExecutedSucessfully message and have Gama State paused or launched.
Click on the play button if the simulation is paused.
You can check that this is working by going to GAMA GUI
In this following flowchart, you can see the whole process to launch a simulation remotely:
Calling an agent action
Enter the action name (for example, say_hello) and an agent reference such as
simulation[0].boids[12]. Use the reference returned by an Expression request
evaluating one_of(boids); do not enter that expression directly in the Agent field.
Leave Agent blank to target the experiment agent.
Arguments must be a JSON object, for example {"the_value":12}.
Leave Arguments blank or enter {} for an action without arguments.
FAQ
Why sometimes I have no response when I want to load an experiment ?
When you reload an experiment, GAMA asks you, via an internal pop-up window, if you're sure you want to do it.
When this happens, you must answer "yes" and GAMA will immediately respond to the loading of the results you previously sent.
If you want to avoid this probem, I suggest to set the global variable pref_experiment_ask_closing to false in the init of the global of your model.
How do I load an experiment after Stop?
Stop closes the experiment. Wait for its successful response; the connector then shows
NONE and Load / Reload sends a new Load request. No page refresh is needed.
While a Load, Reload or Stop request is pending, wait for its response before sending another,
including with Headless mode enabled. This waiting rule belongs to this connector; the server
command names and message formats have not changed, and existing GAML models need no changes.
Use Pause instead of Stop if you want to resume the same experiment.
Why can't the connector connect to Gama Server?
I'll be very clear on this point: if you can't connect to the Gama server, it's either because you haven't specified the right connection port,
or because the Gama Server port hasn't been launched. In no case is it a connector problem.
If Gama Server hasn't launched (you have no way of checking this), go to the settings in the execution > server mode tab and disable server mode,
then save your preferences. Then restart it. This action resets Gama Server.
Why the Gama Server simulation status is UNKNOWN when I'm connecting to Gama Server ?
Simulation status is the state of Gama Server: is a simulation running?
is it paused? The connector knows this status when it receives a SimlationStatus message.
Notifications are sent when the state changes, and can also be sent when the experiment or
destination connection changes even if the state name is unchanged. Connecting alone does not
guarantee an initial status notification, so the connector can initially show UNKNOWN.